class CreateCostLevels < ActiveRecord::Migration
  def self.up
    create_table :cost_levels do |t|
      t.integer :cost_level          ,:limit => 2 ,:default => 0
      t.integer :consumption         ,:limit => 3 ,:default => 0
      t.string :color                ,:limit => 16
      t.string :remark
      t.integer :is_locked           ,:limit => 1 ,:default => 0 #是否管理会要锁定 1为True 0为False
      t.timestamps
    end
    CostLevel.create(:cost_level =>1,:consumption=>500)
    CostLevel.create(:cost_level =>2,:consumption=>1500)
    CostLevel.create(:cost_level =>3,:consumption=>5000)
  end
  
  def self.down
    drop_table :cost_levels
  end
end
